<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        var num = 10;//整数
        num = 29.8;//小数
        // num = "10";//字符串
        // num = '8';//字符串
        // document.write(num+2);

        //检测num的数据类型
        document.write(num);
        document.write(typeof(num));

        document.write("<hr/>");

        var str = "abc";
        str = 'xyz';
        document.write(str);
        document.write("<br/>");
        document.write(typeof(str));

        document.write("<hr/>");

        var boo = false;
        document.write(boo?"真":"假");
        document.write("<br/>");
        document.write(typeof(boo));


        document.write("<hr/>");

        var date = new Date();//创建Date类型的对象
        document.write(date);
        document.write("<br/>");
        document.write(typeof(date));
        document.write("<br/>");
        var user = new Object();//创建一个对象
        document.write(user);


        document.write("<hr/>");
        document.write(age);


    </script>
</body>
</html>